package cn.damai.mine.jvm.classloader;

public class StaticClass {

	static {
		System.out.println(Thread.currentThread().getClass().getSimpleName()
				+ " is inited...");
	}
	
	public static void testMethod(){
		
		System.out.println("叫你一声你敢答应吗？");
		
	}
	
	static class DeadLoopClass {
		
		static {
			if (true) {
				System.out.println(Thread.currentThread() + " init!");
				while (true) {
					
				}
			}
		}
		
		public static void main(String[] args) {
			
			Runnable script = new Runnable() {
				public void run() {
					System.out.println(Thread.currentThread() + " start");
					DeadLoopClass loop = new DeadLoopClass();
					System.out.println(Thread.currentThread() + " run over");
				}
			};
			
			Thread th1 = new Thread(script);
			Thread th2 = new Thread(script);
			
			th1.start();
			th2.start();
		}
		
		
	}

}
